package me.jiatao.usercenter.ui.activity

import android.os.Bundle
import android.view.View
import kotlinx.android.synthetic.main.activity_login.*
import me.jiatao.baselibrary.ext.enable
import me.jiatao.baselibrary.ext.onClick
import me.jiatao.baselibrary.ext.textString
import me.jiatao.baselibrary.ui.activity.BaseMvpActivity
import me.jiatao.baselibrary.ui.activity.BaseTakePhotoActivity
import me.jiatao.usercenter.R
import me.jiatao.usercenter.data.protocol.UserInfo
import me.jiatao.usercenter.injection.component.DaggerUserComponent
import me.jiatao.usercenter.mvp.presenter.LoginPresenter
import me.jiatao.usercenter.mvp.view.LoginView
import org.jetbrains.anko.startActivity

class UserInfoActivity : BaseTakePhotoActivity<LoginPresenter>(), LoginView, View.OnClickListener {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_login)

        initView()
    }

    override fun injectComponent() {
        DaggerUserComponent.builder()
            .activityComponent(mActivityComponent)
            .build()
            .inject(this)

        mPresenter.mView = this
    }


    /**
     *  初始化视图
     */
    private fun initView() {

    }


    /**
     * 点击事件
     */
    override fun onClick(view: View) {

    }


    override fun onLoginResult(result: UserInfo) {
        showToast("登录成功")
    }
}